<template>
  <el-dialog title="信息详情"
    :visible.sync="visible">
    <com-show :info_attr='dataList'></com-show>
    <!-- <span>展示信息详情</span> -->
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <!-- <el-button type="primary" @click="dataFormSubmit()">确定</el-button> -->
      <el-button type="success" @click="checkPass()">通过</el-button>
      <el-button type="danger" @click="checkFail()">不通过</el-button>
    </span>
  </el-dialog>
</template>

<script>
import ComShow  from '../../mymodules/common/com-show'
export default {
  components: {
    ComShow,
  },
  mounted() {
    this.dataList=[
        {attrId: 1, attrName:'物品名称', type:'input',  attrValue:'手机'},
        {attrId: 2, attrName:'可选值', type:'selector',  attrValue:'值1'},
        {attrId: 3, attrName:'时间', type:'datetime',  attrValue:'datetime1'},
        {attrId: 4, attrName:'备注', type:'textarea',  attrValue:'备注dsj'},
        {attrId: 5, attrName:'图片', type:'upload', 
        attrValue:'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg;https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg'},

    ]
  },
  props:{
    
  },
  data() {
    return {
      visible: false,
      infoId: 0,
      dataList: [],
    }
  },
  methods: {
    // 初始化
    init(infoId){
        this.visible = true
        this.infoId = infoId
    },
    // 获取信息详情
    getDataList(){

    },
    // 审核通过 
    checkPass(){
        console.log("审核通过：",this.infoId)
        this.emitCheckEvent(2);
    },
    // 审核不通过
    checkFail(){
        console.log("审核不通过：",this.infoId)
        this.emitCheckEvent(-2);
    },
    // 产生 审核事件
    emitCheckEvent(pass){
        this.visible = false;
        this.$emit("checkEvent", this.infoId, pass);
    }
  },
}
</script>

<style>

</style>